//
//  ViewController.m
//  Animation
//
//  Created by iD Student on 7/9/13.
//  Copyright (c) 2013 Apple Inc. All rights reserved.
//

#import "ViewController.h"

@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad

{
    [super viewDidLoad];
  /*  animatedImage.animationImages = [NSArray arrayWithObjects:
                                     [UIImage imageNamed:@"IMG1.png"],
                                     [UIImage imageNamed:@"IMG2.png"],
                                     [UIImage imageNamed:@"IMG3.png"],
                                     [UIImage imageNamed:@"IMG4.png"],
                                     [UIImage imageNamed:@"IMG5.png"],
                                     [UIImage imageNamed:@"IMG6.png"],
                                     [UIImage imageNamed:@"IMG7.png"],
                                     [UIImage imageNamed:@"IMG8.png"],
                                     [UIImage imageNamed:@"IMG9.png"],
                                     [UIImage imageNamed:@"IMG10.png"],
                                     [UIImage imageNamed:@"IMG11.png"],
                                     [UIImage imageNamed:@"IMG12.png"],
                                     [UIImage imageNamed:@"IMG13.png"],
                                     [UIImage imageNamed:@"IMG14.png"],
                                     [UIImage imageNamed:@"IMG15.png"],
                                     [UIImage imageNamed:@"IMG16.png"],
                                     [UIImage imageNamed:@"IMG17.png"],
                                     [UIImage imageNamed:@"IMG18.png"],
                                     [UIImage imageNamed:@"IMG19.png"],
                                     [UIImage imageNamed:@"IMG20.png"],
                                     [UIImage imageNamed:@"IMG21.png"], nil];
   */
    NSMutableArray *imageArray = [[NSMutableArray alloc]init];
    for (int i = 1; i < 67; i++) {
        [imageArray insertObject:[UIImage imageNamed:[NSString stringWithFormat:@"TPBPlazma-1-%i (dragged).tiff", i]] atIndex:(i-1)];
    }
    animatedImage.animationImages = imageArray;
    animatedImage.animationDuration = 5.0;
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

- (IBAction)cancelButton:(id)sender {
    
    [animatedImage stopAnimating];
}

- (IBAction)startButton:(id)sender {
    if(animatedImage.isAnimating == true)
    {
    [animatedImage stopAnimating];
    [animatedImage startAnimating];
    }
    else
    {
        [animatedImage startAnimating];
    }
}

- (void)dealloc {
    [super dealloc];
}

@end
